package com.worthtech.billportal.bean.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the acl_permission table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="acl_permission"
 */

public abstract class BasePermission  implements Serializable {

	public static String REF = "Permission";
	public static String PROP_RESOURCE = "Resource";
	public static String PROP_ACTION = "Action";
	public static String PROP_MODULE_ID = "ModuleId";
	public static String PROP_PERMISSION_NAME = "PermissionName";
	public static String PROP_DESCRIPTION = "Description";
	public static String PROP_CREATE_BY = "CreateBy";
	public static String PROP_TYPE_ID = "TypeId";
	public static String PROP_PRIO = "Prio";
	public static String PROP_CREATE_DATE = "CreateDate";
	public static String PROP_ID = "Id";


	// constructors
	public BasePermission () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BasePermission (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BasePermission (
		java.lang.Integer id,
		java.lang.String permissionName,
		java.lang.String resource,
		java.lang.String action,
		java.lang.Integer typeId) {

		this.setId(id);
		this.setPermissionName(permissionName);
		this.setResource(resource);
		this.setAction(action);
		this.setTypeId(typeId);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String permissionName;
	private java.lang.String resource;
	private java.lang.String action;
	private java.lang.String description;
	private java.lang.Integer typeId;
	private java.lang.Integer moduleId;
	private java.lang.Integer prio;
	private java.lang.String createBy;
	private java.util.Date createDate;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="ID"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: PermissionName
	 */
	public java.lang.String getPermissionName () {
		return permissionName;
	}

	/**
	 * Set the value related to the column: PermissionName
	 * @param permissionName the PermissionName value
	 */
	public void setPermissionName (java.lang.String permissionName) {
		this.permissionName = permissionName;
	}



	/**
	 * Return the value associated with the column: Resource
	 */
	public java.lang.String getResource () {
		return resource;
	}

	/**
	 * Set the value related to the column: Resource
	 * @param resource the Resource value
	 */
	public void setResource (java.lang.String resource) {
		this.resource = resource;
	}



	/**
	 * Return the value associated with the column: Action
	 */
	public java.lang.String getAction () {
		return action;
	}

	/**
	 * Set the value related to the column: Action
	 * @param action the Action value
	 */
	public void setAction (java.lang.String action) {
		this.action = action;
	}



	/**
	 * Return the value associated with the column: Description
	 */
	public java.lang.String getDescription () {
		return description;
	}

	/**
	 * Set the value related to the column: Description
	 * @param description the Description value
	 */
	public void setDescription (java.lang.String description) {
		this.description = description;
	}



	/**
	 * Return the value associated with the column: TypeId
	 */
	public java.lang.Integer getTypeId () {
		return typeId;
	}

	/**
	 * Set the value related to the column: TypeId
	 * @param typeId the TypeId value
	 */
	public void setTypeId (java.lang.Integer typeId) {
		this.typeId = typeId;
	}



	/**
	 * Return the value associated with the column: ModuleId
	 */
	public java.lang.Integer getModuleId () {
		return moduleId;
	}

	/**
	 * Set the value related to the column: ModuleId
	 * @param moduleId the ModuleId value
	 */
	public void setModuleId (java.lang.Integer moduleId) {
		this.moduleId = moduleId;
	}



	/**
	 * Return the value associated with the column: Prio
	 */
	public java.lang.Integer getPrio () {
		return prio;
	}

	/**
	 * Set the value related to the column: Prio
	 * @param prio the Prio value
	 */
	public void setPrio (java.lang.Integer prio) {
		this.prio = prio;
	}



	/**
	 * Return the value associated with the column: CreateBy
	 */
	public java.lang.String getCreateBy () {
		return createBy;
	}

	/**
	 * Set the value related to the column: CreateBy
	 * @param createBy the CreateBy value
	 */
	public void setCreateBy (java.lang.String createBy) {
		this.createBy = createBy;
	}



	/**
	 * Return the value associated with the column: CreateDate
	 */
	public java.util.Date getCreateDate () {
		return createDate;
	}

	/**
	 * Set the value related to the column: CreateDate
	 * @param createDate the CreateDate value
	 */
	public void setCreateDate (java.util.Date createDate) {
		this.createDate = createDate;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.worthtech.billportal.bean.Permission)) return false;
		else {
			com.worthtech.billportal.bean.Permission permission = (com.worthtech.billportal.bean.Permission) obj;
			if (null == this.getId() || null == permission.getId()) return false;
			else return (this.getId().equals(permission.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}